package com.sunshine.simplehospital.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter
import com.sunshine.simplehospital.R
import com.sunshine.simplehospital.ui.fragment.DefaultFragment

/**
 * Created by sunshine on 2020/4/29
 */
class RecordAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm) {

    private val list = ArrayList<Fragment>()

    init {
        list.apply {
            add(DefaultFragment().newInstance(R.layout.geren_fragment)!!)
            add(DefaultFragment().newInstance(R.layout.yizhu_fragment)!!)
        }
    }

    override fun getItem(position: Int): Fragment {
        return list[position]
    }

    override fun getCount(): Int {
        return list.size
    }
}